const mongoose = require('mongoose')

const Schema = mongoose.Schema

const CarSchema = new Schema({
  // 车的种类
  category_id: { type: Schema.Types.ObjectId, ref: 'Category' },
  // 车的类型
  type_id: { type: Schema.Types.ObjectId, ref: 'Type' },
  // 属于哪个店
  shop_id: { type: Schema.Types.ObjectId, ref: 'Shop' },
  // 车牌号
  license_number: {
    type: String,
    unique: true,
  },
  // 是否在租借
  is_rend: {
    type: Number,
    default: 0,
  },
})

const CarModel = mongoose.model('Car', CarSchema)

module.exports = CarModel
